package com.zyong.design.pattern.decorator.case3;

/**
 * @program: zyong-design-pattern
 * @ClassName: MilkDecorator
 * @author: zyong
 * @create: 2024-04-29 00:06
 */
public class MilkDecorator implements CoffeeDecorator {
    private Coffee coffee;

    @Override
    public String getName() {
        return coffee.getName() + ", 牛奶";
    }

    @Override
    public double getPrice() {
        return coffee.getPrice() + 0.5;
    }

    @Override
    public void setCoffee(Coffee coffee) {
        this.coffee = coffee;
    }
}
